﻿<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"    
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:nRoute="using:nRoute.Controls"
  xmlns:vsm="using:Windows.UI.Xaml">

    <Style TargetType="nRoute:NavigationContentControl">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0,0,0,0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="nRoute:NavigationContentControl">
                    <Border 
						Background="{TemplateBinding Background}" 
						BorderBrush="{TemplateBinding BorderBrush}"  
				        BorderThickness="{TemplateBinding BorderThickness}" 
                        HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
	                    VerticalAlignment="{TemplateBinding VerticalAlignment}">

                        <!-- CONTENT -->
                        <ContentPresenter 
							ContentTransitions="{TemplateBinding ContentTransitions}" 
							ContentTemplate="{TemplateBinding ContentTemplate}"
							Content="{TemplateBinding Content}"
                            Margin="{TemplateBinding Padding}"
							HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
	                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="nRoute:NavigationContainer">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="#FF000000"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Padding" Value="0,0,0,0"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <!-- TEMPLATE-->
                <ControlTemplate TargetType="nRoute:NavigationContainer">
                    <Border Background="{TemplateBinding Background}" 
							BorderBrush="{TemplateBinding BorderBrush}"  
				            BorderThickness="{TemplateBinding BorderThickness}" 
                            HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
	                        VerticalAlignment="{TemplateBinding VerticalAlignment}">

                        <!-- VSM RELATED -->
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="NavigationStates">

                                <!-- STATES -->
                                <vsm:VisualState x:Name="UnNavigated">
                                </vsm:VisualState>

                                <vsm:VisualState x:Name="Navigating">
                                    <Storyboard RepeatBehavior="ForEver" BeginTime="00:00:00" AutoReverse="False">
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="IndicatorBorder" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="(UIElement.IsActive)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="True"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>

                                <vsm:VisualState x:Name="Navigated">
                                    <Storyboard  BeginTime="00:00:00" AutoReverse="False" Duration="00:00:01.500">                                        
                                        <PopInThemeAnimation Duration="00:00:01.500" TargetName="RootGrid" />
                                    </Storyboard>
                                </vsm:VisualState>

                                <vsm:VisualState x:Name="NavigationFailed">
                                    <Storyboard  BeginTime="00:00:00" AutoReverse="False" Duration="00:00:01.500">
                                        <PopInThemeAnimation Duration="00:00:01.500" TargetName="RootGrid" />
                                    </Storyboard>
                                </vsm:VisualState>

                                <!-- TRANSITIONS
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00" To="NavigationFailed"/>
                                    <vsm:VisualTransition From="NavigationFailed" GeneratedDuration="00:00:00"/>
                                </vsm:VisualStateGroup.Transitions> -->

                            </vsm:VisualStateGroup>

                        </vsm:VisualStateManager.VisualStateGroups>

                        <!-- VISUALS -->
                        <Grid x:Name="RootGrid">

                            <!-- CONTENT -->
                            <ContentPresenter 
							    ContentTransitions="{TemplateBinding ContentTransitions}" 
							    ContentTemplate="{TemplateBinding ContentTemplate}"
								Content="{TemplateBinding Content}"
                            	Margin="{TemplateBinding Padding}"
								HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>

                            <!-- NAVIGATON OVERLAY -->
                            <Border x:Name="IndicatorBorder" Background="#99000000" Visibility="Collapsed">
                                <ProgressRing x:Name="IndicatorRing" IsActive="False" Foreground="White" />
                            </Border>

                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>